<?php
class My_Controller extends CI_Controller {
	
	var $data;
    public function __construct($menu) {
    	date_default_timezone_set('Asia/Saigon');
        //echo "<script> alert($menu)</script>";
        parent::__construct();
        $this->load->model('authentication_model');
        $this->authentication_model->checkLogin();         
        $this->data = array();
        $this->load->library('template');
        $this->template->set_template('admin_temp');
        
        // Add DocType
        $this->template->add_doctype();        
            	        
        // Add meta
    	$this->template->add_meta('viewport','width=device-width; initial-scale=1.0; maximum-scale=1;');
    	$this->template->add_meta('apple-mobile-web-app-capable','yes');
    	$this->template->add_meta('apple-mobile-web-app-status-bar-style','black-translucent');
    	
        // Add title
        $this->template->add_title('Quản lý trang VTV-Thời tiết');
		
        // Add CSS and JS
        $this->template->add_css('css/all.css');
        $this->template->add_js($this->config->item('link_font').'jwplayer/jwplayer.js');
		//$this->template->add_js('js/jquery.js');
		$this->template->add_js('js/jquery.min.js');
		$this->template->add_js('js/jquery-ui.js');
		$this->template->add_js('js/fancybox/jquery.fancybox-1.3.4.js');
		$this->template->add_js('js/quicksand/jquery.quicksand.js');
		$this->template->add_js('js/quicksand/custom_sorter.js');
		$this->template->add_js('js/quicksand/dash_sorter.js');
		$this->template->add_js('js/quicksand/jquery-css-transform.js');
		$this->template->add_js('js/quicksand/jquery-animate-css-rotate-scale.js');
		$this->template->add_js('js/jqueryFileTree/jqueryFileTree.js');
		$this->template->add_js('js/DataTables/jquery.dataTables.js');
		$this->template->add_js('js/slidernav/slidernav.js');
		$this->template->add_js('js/plugins.js');
		$this->template->add_js('js/tinymce/jscripts/tiny_mce/tiny_mce.js');
		$this->template->add_js('js/adminica/adminica_ui.js');
		switch ($this->session->userdata('level')){
			case '1':
				$this->data['userlevel'] = 'Biên tập viên';
				break;
			case '2':
				$this->data['userlevel'] = 'Moderator';
				break;
			case '3':
				$this->data['userlevel'] = 'Administrator';
				break;
		}
        // Parse data into view 
        $this->template->parse_view('topbar' , 'template/topbar.html' , $this->data);
        $this->template->parse_view('sidebar' , 'template/sidebar.html' , $this->data);
        $this->data['menu'] = $menu;
        $this->template->parse_view('menu' , 'template/menu.html' , $this->data);
    }
    
}
?>